package com.exchange.controller;

import com.exchange.entity.vo.CardDisplayVo;
import com.exchange.service.CardRollService;
import com.exchange.until.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 董慧珍
 * @Date 2024/04/25
 * @Version 1.0
 **/
@Slf4j
@RestController
@RequestMapping("/jeecg-boot")
@Tag(name = "卡卷")
public class CardDisplayController {
    @Autowired
    private CardRollService cardRollService;
    @GetMapping("/MyCardListByType")
    public Result MyCardListByType(@RequestHeader("token")String token,Integer type) {
        log.info("MyCardListByType");

        return Result.success(cardRollService.MyCardListByType(token, type));
    }
     @GetMapping("/list")
    @Operation(summary = "卡卷列表")
    public Result list(@RequestHeader String token) {
         List<CardDisplayVo> all = this.cardRollService.findAll(token);
         return Result.success(all);
    }
}
